<template>
    <div
      style="width:1200px;margin:0px auto;">
      <div style="padding: 10px 0px;height: 382px">
        <el-carousel indicator-position="outside" style="height: 100%">
          <el-carousel-item v-for="item in adList" :key="item">
            <el-image style="float: bottom" :src="item.image" fit="fill"></el-image>
          </el-carousel-item>
        </el-carousel>
      </div>
      <div>
        <div style="text-align: center">
          <el-card class=""  style="display:inline-block;margin: 5px;width: 388px" v-for="(t, index) in showList" :key="index">
            {{t.title}}
          </el-card>
        </div>
      </div>
    </div>
</template>

<script>
export default {
  name: 'AppIndex',
  data () {
    return {
      adList: [],
      showList: [
        {
          title: '免费课程'
        },
        {
          title: '在线笔记'
        },
        {
          title: '精品资源'
        },
        {
          title: '免费入驻'
        },
        {
          title: '完美体验'
        },
        {
          title: '在线问答'
        }
      ]
    }
  },
  mounted () {
    this.getListAD()
  },
  methods: {
    getListAD () {
      var _this = this
      this.$axios.post('/api/ad/getListAD')
        .then(function (response) {
          var result = response.data
          if (result.isSuccess) {
            _this.adList = result.result
          }
        })
    }
  }
}
</script>

<style scoped>

</style>
